import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
import { AdminModel, AdminService } from './admin.service';

@Injectable({
	providedIn: 'root',
})
export class AddService implements Resolve<AdminModel[]> {
	constructor(private adminService: AdminService) {}
	resolve() {
		return this.adminService.list().then(resp => resp.list);
	}
}
